﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HDJ.Framework.Core;

namespace HDJ.Framework.Core
{
    public static class PreLoadResourceController
    {

        public static CallBack<int, int> progressCallBack;
        public static CallBack<string> showContentCallBack;

        public static void StartLoadResource(CallBack completeCallBack)
        {
            //AssetsData ads = ResourceManager.Load("AssetBundleInfo");

            //TextAsset tx = ads.asset as TextAsset;
            //Dictionary<string, object> tempDic = InternalConfigManager.LoadData(tx.text);
            //string s = tempDic["preLoadResPaths"].ToString();
            //List<string> pathNames = tempDic["preLoadResPaths"] as List<string>;
            //int count = pathNames.Count;
            //ResourceManager.LoadManyAssetAsyncByName(pathNames, (num) =>
            //{
            //    int left = count - num + 1;
            //    //Debug.LogError("Left :" + num);
            //    if (progressCallBack != null)
            //    {
            //        progressCallBack(count, count - num);
            //    }
            //    if (showContentCallBack != null)
            //    {
            //        string ss ="Preload("+(count-num)+" / " + count+")";
            //        showContentCallBack(ss);
            //    }
            //}, completeCallBack);

        }
    }
   
}
